<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
		
			//在当前window对象下注册的方法
			function fun(){
				console.log("fun");
				console.log(this); //window
			}
		
		
			var zhangfei = {
				name:'张飞',
				age :18,
				sayHi:function (){
					console.log(this);	
					console.log("sayHi name is:"+this.name)
				}
			}
			
			//调用属性，方法   zhangfei.属性    zhangfei.方法（）
			window.fun();
			
			zhangfei.sayHi()
		
			
		</script>
		</head>
	<body>
		
		
		
	</body>
</html>
